package com.yonyou.pmclouds.workflow.entity;

import com.yonyou.pmclouds.basecom.entity.SuperVO;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotNull;
import java.util.Date;

@Table(name = "pm_process_definition")
@Setter
@Getter
public class ProcessDefinitionVO extends SuperVO {

    private static final long serialVersionUID = 5697380850782320870L;

    public static final String PROCESS_STATUS = "processStatus";

    public static final String PROCESS_STATUS_START = "start";

    public static final String PROCESS_STATUS_STOP = "stop";

    public static final String PK_PROCESS_DEFINITION = "pkProcessDefinition";

    public static final String PK_ORG = "pkOrg";

    public static final String PROCESS_NAME = "processName";

    public static final String IS_ASSIGN_FILTER = "isAssignFilter";

    // 集团
    public static final int SCOPE_GROUP = 1;

    // 组织
    public static final int SCOPE_ORG = 0;

    @Id
    private String pkProcessDefinition;
    // 单据类型
    @NotNull(message = "单据类型不能为空")
    private String billType;
    // 单据名称
    @NotNull(message = "单据名称不能为空")
    private String billName;
    // 流程名称
    @NotNull(message = "流程名称不能为空")
    private String processName;
    // 流程key
    private String processKey;
    // 流程状态
    private String processStatus;
    // 流程主键
    private String processId;
    // 组织主键
    private String pkOrg;
    // 指派是否按照项目团队过滤
    private int isAssignFilter;
    // 适用范围
    @NotNull(message = "适用范围不能为空")
    private int scope;

    // 操作人ID
    @Transient
    @NotNull(message = "操作人不能为空")
    private String userId;

    /*** 通用字段 **/
    @NotNull(message = "租户ID不能为空")
    private String pkTenant;
    private String creator;
    private Date creationtime;
    private String modifier;
    private Date modifytime;

    //组织名称，用于拼接流程的名称，保存到云审里
    @Transient
    private String orgName;
}
